bitkeeper revision 1.1159.1.469 (41a9c2bcqd7AcyR2IqZKFxYUW-XVPg)
authorcl349@arcadians.cl.cam.ac.uk <cl349@arcadians.cl.cam.ac.uk>
Sun, 28 Nov 2004 12:21:16 +0000 (12:21 +0000)
committercl349@arcadians.cl.cam.ac.uk <cl349@arcadians.cl.cam.ac.uk>
Sun, 28 Nov 2004 12:21:16 +0000 (12:21 +0000)
domain.c:
  Check iopl when booting additional cpus.
smpboot.c:
  Set iopl when booting additional cpus.

linux-2.6.9-xen-sparse/arch/xen/i386/kernel/smpboot.c
xen/arch/x86/domain.c

index 4eef120ba8f3e2bed094e006122192302619a51b..5e2e798628bb475993e77a53f96f3ef9e011e5d2 100644 (file)
@@ -880,7 +880,7 @@ static int __init do_boot_cpu(int apicid)
        ctxt.cpu_ctxt.cs = __KERNEL_CS;
        ctxt.cpu_ctxt.eip = start_eip;
        ctxt.cpu_ctxt.esp = idle->thread.esp;
-       ctxt.cpu_ctxt.eflags = (1<<9) | (1<<2);
+       ctxt.cpu_ctxt.eflags = (1<<9) | (1<<2) | (idle->thread.io_pl<<12);
 
        /* FPU is set up to default initial state. */
        memset(ctxt.fpu_ctxt, 0, sizeof(ctxt.fpu_ctxt));
index 5e6042f50c4a1854a5d4f19911573681f4392a7c..a459c50fcd2463abf4e81a37bbbeaf72831619c5 100644 (file)
@@ -248,6 +248,10 @@ int arch_final_setup_guestos(struct exec_domain *d, full_execution_context_t *c)
            &c->cpu_ctxt,
            sizeof(d->thread.user_ctxt));
 
+    /* Clear IOPL for unprivileged domains. */
+    if (!IS_PRIV(d->domain))
+        d->thread.user_ctxt.eflags &= 0xffffcfff;
+
     /*
      * This is sufficient! If the descriptor DPL differs from CS RPL then we'll
      * #GP. If DS, ES, FS, GS are DPL 0 then they'll be cleared automatically.